package com.mass.core.sys.role.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mass.core.sys.role.model.SysRole;
import com.mass.core.sys.role.services.SysRoleServices;
import com.mass.core.utils.AjaxResponse;

/**
 * 
 * @ProjectName:  [demo-ht] 
 * @Package:      [com.mass.core.sys.role.components.SysRoleController.java]
 * @ClassName:    [SysRoleController]   
 * @Description:  [角色管理]   
 * @Author:       [张双喜]
 * @CreateDate:   [2018年6月18日 下午10:15:21]   
 * @UpdateUser:   [zsx]   
 * @UpdateDate:   [2018年6月18日 下午10:15:21]   
 * @UpdateRemark: [说明本次修改内容] 
 * @Since         [JDK1.7]
 * @Version:      [v1.0]
 *
 */
@RestController
@RequestMapping("/sysRole")
public class SysRoleController {

	@Autowired
	private SysRoleServices sysRoleServices;
	
	@RequestMapping("/findRoleList")
	public AjaxResponse findRoleList(SysRole sysRole, Integer page,
			Integer limit){
		return sysRoleServices.findRoleList(sysRole, page, limit);
	}

	@RequestMapping("/findAutorityAll")
	public AjaxResponse findAutorityAll(Long roleId){
		return sysRoleServices.findAutorityAll(roleId);
	}

    //修改
	@RequestMapping("/editSysAuthority")
	public AjaxResponse editSysAuthority(SysRole sysRole){
		return sysRoleServices.editSysAuthority(sysRole.getSysAuthorityList(),sysRole);
	}
    //添加角色
    @RequestMapping("/addSysAuthority")
    public AjaxResponse addSysAuthority(SysRole sysRole){
        return sysRoleServices.addSysAuthority(sysRole);
    }
    
    @RequestMapping("/findRoleListTheOnly")
	public AjaxResponse findRoleListTheOnly(SysRole sysRole, Integer page,
			Integer limit){
		return sysRoleServices.findRoleListTheOnly(sysRole, page, limit);
	}
    
}
